<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">
	<link href="{$smarty.const.CSS_PATH}bootstrap.min.css" rel="stylesheet">
    <link href="{$smarty.const.CSS_PATH}toastr.css" rel="stylesheet">
    <title>首页</title>

    <!-- Bootstrap core CSS -->
    <link href="{$smarty.const.CSS_PATH}bootstrap.min.css" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="jumbotron.css" rel="stylesheet">
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>
    <script type="text/javascript">
    	function check(){
    		var name=document.getElementById("name").value;
    		$.post("{$smarty.const.__MODULE__}/User/is_used","name="+name,function(msg){
    			if(msg=="true"&&name!=''){
    				toastr.error("不存在此用户！！o(╥﹏╥)o!");  
    			}else if(msg=="false"&&name!=''){
    				toastr.info("用户名正确！"); 
    			}
    		});
    	}
    </script>
  </head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">首页</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
        {if $smarty.session.name==null}
          <form class="navbar-form navbar-right" action="{$smarty.const.__MODULE__}/user/login" method="post">
            <div class="form-group">
              <input type="text" placeholder="用户名" id="name" name="name" class="form-control" onblur="check()">
            </div>
            <div class="form-group">
              <input type="password" id="password" name="password" placeholder="密码" class="form-control">
            </div>
            <button type="submit" class="btn btn-success">登录</button>
            <a class="btn btn-info" href="{$smarty.const.__MODULE__}/User/register" role="button">注册</a>
          </form>
        {else }
        	<form class="navbar-form navbar-right" action="{$smarty.const.__MODULE__}/user/login" method="post">
          		<div class="form-group">
            		<span><font style="font-size: 20px;color:white;margin-right: 20px;margin-top: 0px;">欢迎您！{$smarty.session.name}</font></span>
            		<a href="#"><img src="{$smarty.const.IMAGES_PATH}k3.jpg" alt="..." class="img-circle" style="height: 40px;width: 40px;"></a>
          		</div>
          	</form>
		{/if}
        </div><!--/.navbar-collapse -->
      </div>
    </nav>
    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
      <div class="container">
        <h1>欢迎你！</h1>
        <p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
        <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p>
      </div>
    </div>

    <div class="container">
      <!-- Example row of columns -->
      <div class="row">
        <div class="col-md-4">
          <h2>网上商城</h2>
          <p>购买商品</p>
          <p><a class="btn btn-default" href="{if $smarty.session.name!=null}{$smarty.const.__CONTROLLER__}/goalstore{else}javascript:alert('请先登录哦!'){/if}" role="button">进去看看 &raquo;</a></p>
        </div>
        <div class="col-md-4">
          <h2>积分商城</h2>
          <p>在这里，你可以把购物所得的积分兑换成实体。</p>
          <p><a class="btn btn-default" href="{if $smarty.session.name!=null}{$smarty.const.__MODULE__}/IntegralGoods/goalstore{else}javascript:alert('请先登录哦!'){/if}" role="button">进去看看 &raquo;</a></p>
       </div>
        <div class="col-md-4">
          <h2>广告出租</h2>
          <p>大家好，我是古天乐，我是渣渣辉，贪玩蓝月，这是你没有玩过的全新版本，只需体验三分钟，你就会和我一样，爱上这款游戏。</p>
          <p><a class="btn btn-default" href="{if $smarty.session.name!=null}{$smarty.const.__CONTROLLER__}/goalstore{else}javascript:alert('请先登录哦!'){/if}" role="button">进去看看 &raquo;</a></p>
        </div>
      </div>

      <hr>

      <footer>
        <p>&copy; 2016 Company, Inc.</p>
      </footer>
    </div> <!-- /container -->


    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<script>window.jQuery || document.write('<script src="../assets/js/vendor/jquery.min.js"><\/script>')</script>
  	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  	<script src="{$smarty.const.JS_PATH}toastr.js"></script>
    
  </body>
</html>
